12437c30b92793499dc3dd1be572271194ce7dba,src/main/java/edu/sc/seis/TauP/SphericalSModel.java,SphericalSModel,layerTimeDist,#number#number#boolean#,193

Before Change


        if(sphericalLayer.getTopDepth() == sphericalLayer.getBotDepth()) {
            timedist.time = 0.0;
            timedist.distRadian = 0.0;
            return timedist;
        }
        /*
         * Check to see if this layer contains the center of the earth. If so
         * then the spherical ray parameter should be 0.0 and we calculate the
         * range and time increments using a constant velocity layer (sphere).
         * See eq 43 and 44 of Buland and Chapman, although we implement them
         * slightly differently. Note that the distance and time increments are
         * for just downgoing or just up going, ie top of the layer to the
         * center of the earth or vice versa but not both. This is in keeping
         * with the convention that these are one way distance and time
         * increments. We will multiply the result by 2 at the end, or if we are
         * doing a 1.5D model, the other direction may be different. The time
         * increment for a ray of zero ray parameter passing half way through a
         * sphere of constant velocity is just the spherical slowness at the top
         * of the sphere. An amazingly simple result!
         */
        if(sphericalRayParam == 0.0
                && sphericalLayer.getBotDepth() == radiusOfEarth) {
            if(layerNum != getNumLayers(isPWave) - 1)
                throw new SlownessModelException("There are layers deeper than the center of the earth!");
            timedist.distRadian = Math.PI / 2.0;
            timedist.time = sphericalLayer.getTopP();
            if(DEBUG) {
                System.out.println("Center of Earth: dist " + timedist.distRadian
                        + " time " + timedist.time);
            }
            if(timedist.distRadian < 0.0 || timedist.time < 0.0
                    || Double.isNaN(timedist.time)
                    || Double.isNaN(timedist.distRadian)) {
                throw new SlownessModelException("CoE timedist <0.0 or NaN: "
                        + "sphericalRayParam= " + sphericalRayParam
                        + " botDepth = " + sphericalLayer.getBotDepth()

After Change


            double distRadian = Math.asin(b * sphericalRayParam * vel
                    / (topRadius * botRadius));
            if(distRadian < 0.0 || time < 0.0
                    || Double.isNaN(time)
                    || Double.isNaN(distRadian)) {
                throw new SlownessModelException("CVL timedist <0.0 or NaN: "
                        + "\nsphericalRayParam= " + sphericalRayParam
                        + "\n botDepth = " + sphericalLayer.getBotDepth()